﻿using System;
using System.IO;
using System.Collections.Generic;
using System.Windows.Forms;

namespace 辽宁彩铃处理器
{
	static class Program
	{
		/// <summary>
		/// 应用程序的主入口点。
		/// </summary>
		[STAThread]
		static void Main()
		{
			if (Application.ExecutablePath.IndexOf("bin") >= 0)
			{
				Application.EnableVisualStyles();
				Application.SetCompatibleTextRenderingDefault(false);
				Application.Run(new CFormMain());
				return;
			}

			try
			{
				Application.EnableVisualStyles();
				Application.SetCompatibleTextRenderingDefault(false);
				Application.Run(new CFormMain());
			}
			catch (Exception x)
			{
				StreamWriter sw = new StreamWriter(new FileStream(Application.ExecutablePath + ".err", FileMode.Create, FileAccess.Write));
				Exception exception = x;
				for (int i = 0; i < byte.MaxValue; i++)
				{
					sw.WriteLine(i);
					sw.WriteLine(exception.Source);
					sw.WriteLine(exception.Message);
					sw.WriteLine(exception.StackTrace);
					sw.WriteLine();
					exception = exception.InnerException;
					if (exception == null)
						break;
				}
				sw.Flush();
				sw.Close();
				sw.Dispose();
				sw = null;
			}
		}
	}
	//
}
//
